<?php
namespace app\admin\controller;

use app\AdminBaseController;
use app\admin\model\Nav;

class Index extends AdminBaseController
{
    /**
     * 后台首页
     */
    public function index()
    {
        $nav = new Nav();
        $ruleIds=$nav->getRuleIds()??[1];
        $assignData=[
            "data"    =>$nav->getNavList($this->uid == 1?[]:$ruleIds),
            "username"=>$this->username,
            "uid"     =>$this->uid,
            "userimg" =>$this->userimg
        ];
        return view("index",$assignData);
    }

    /**
     * 概览
     */
    public function welcome()
    {
        return view();
    }
}
